# Contributor: Martin Rusko <martin.rusko@gmail.com>
# Maintainer: Martin Rusko <martin.rusko@gmail.com>
pkgname=minidyndns
pkgver=1.3.0
pkgrel=3
pkgdesc="A simple no fuss DNS server with built-in HTTP/HTTPS interface to update IPs"
url="https://github.com/arkanis/minidyndns"
arch="noarch"
license="MIT"
depends="ruby"
options="!check" # there is no testing suite at the moment
subpackages="$pkgname-doc $pkgname-openrc"
source="minidyndns-$pkgver.tar.gz::https://github.com/arkanis/minidyndns/archive/v$pkgver.tar.gz
	minidyndns.initd
	minidyndns.confd
	"

package() {
	install -Dm755 "$srcdir"/minidyndns.initd \
		"$pkgdir"/etc/init.d/minidyndns
	install -Dm644 "$srcdir"/minidyndns.confd \
		"$pkgdir"/etc/conf.d/minidyndns

	install -Dm755 "$builddir"/dns.rb \
		"$pkgdir"/usr/share/minidyndns/dns.rb

	install -Dm644 "$builddir"/config.example.yml \
		"$pkgdir"/etc/minidyndns_config.yml

	install -d -o nobody -g nogroup "$pkgdir"/var/log/minidyndns

	install -d -o nobody -g nogroup "$pkgdir"/var/lib/minidyndns
	install -Dm640 -o nobody -g nogroup "$builddir"/db.example.yml \
		"$pkgdir"/var/lib/minidyndns/db.yml

	install -Dm644 "$builddir"/config.example.yml \
			"$pkgdir"/usr/share/doc/minidyndns/config.example.yml

	install -Dm644 "$builddir"/db.example.yml \
			"$pkgdir"/usr/share/doc/minidyndns/db.example.yml

	install -Dm644 "$builddir"/README.md \
			"$pkgdir"/usr/share/doc/minidyndns/README.md
}

sha512sums="994ef4011a9435fbf29a6addade4357a0eefe672a8e1159ed838373524186d2c1ecedef8cce63123ccb81c236111c18a84cc0812fd5356c272aa924fab8e970d  minidyndns-1.3.0.tar.gz
90ca8d913b3459f852d31ca21ced4ec3f5ae0cd17e31d4c37022ad78b52e6ae3fe37dfa0b6b9c289b1ffab8c858c342cec1c650e4b11ee629bd8c9b1346cf54c  minidyndns.initd
fb5b068681c1b41331097962d4e71dfd83d61b97c20ece6796a8f8fcbd7f90cb76f7b05b5112aca87cc7920f3264fd475473a807e032dff22380ec3ef4445a5d  minidyndns.confd"
